package com.gc.ykqx.service.manager;

import android.content.Context;

import com.gc.ykqx.service.RetrofitHelper;
import com.gc.ykqx.service.RetrofitService;
import com.gc.ykqx.service.entity.AppInfo;
import com.gc.ykqx.service.entity.Fore;
import com.gc.ykqx.service.entity.Fylz;
import com.gc.ykqx.service.entity.LatestWea;
import com.gc.ykqx.service.entity.Past24;
import com.gc.ykqx.service.entity.SiteResponse;
import com.gc.ykqx.service.entity.Warn;
import com.gc.ykqx.service.entity.WeaResponse;
import com.gc.ykqx.service.util.Constant;

import rx.Observable;

/**
 * Created by wsd on 2017/9/30.
 */

public class DataManager {
    private RetrofitService mRetrofitService;

    public DataManager(Context context) {
        this.mRetrofitService = RetrofitHelper.getInstance(context).getServer();
    }

    public Observable<SiteResponse> getQySite() {
        return mRetrofitService.getQySite();
    }

    public Observable<SiteResponse> getSwSite() {
        return mRetrofitService.getSwSite();
    }

    public Observable<WeaResponse> getWeaMin(String staIds, String time, String element) {
        return mRetrofitService.getWeaMin(staIds, time, Constant.ELEMENT_STATION_ID + element);
    }

    public Observable<WeaResponse> getWeaHor(String staIds, String time, String element) {
        return mRetrofitService.getWeaHor(staIds, time, Constant.ELEMENT_STATION_ID + element);
    }

    public Observable<WeaResponse> getWeaDay(String staIds, String time, String element) {
        return mRetrofitService.getWeaDay(staIds, time, Constant.ELEMENT_STATION_ID + element);
    }

    public Observable<WeaResponse> getWeaEvsByTimeAndStaIds(String staIds, String time, String element) {
        return mRetrofitService.getWeaEvsByTimeAndStaIds(staIds, time, Constant.ELEMENT_STATION_ID + element);
    }

    public Observable<WeaResponse> getWeaEvsByStaIds(String staIds, String element) {
        return mRetrofitService.getWeaEvsByStaIds(staIds, Constant.ELEMENT_STATION_ID + element);
    }

    public Observable<WeaResponse> getWeaFromHour(String staIds, String element) {
        return mRetrofitService.getWeaFromHour(staIds, Constant.ELEMENT_STATION_ID + element);
    }

    public Observable<WeaResponse> getWeaSwHor(String staIds, String time, String element) {
        return mRetrofitService.getWeaSwHor(staIds, time, Constant.ELEMENT_STATION_ID + element);
    }

    public Observable<WeaResponse> getWeaDayCount(String staIds, String element, String beginTime, String endtime) {
        return mRetrofitService.getWeaDayCount(staIds, Constant.ELEMENT_STATION_ID + element, beginTime, endtime);
    }

    public Observable<WeaResponse> getWeaHorCount(String staIds, String element, String beginTime, String endtime) {
        return mRetrofitService.getWeaHorCount(staIds, Constant.ELEMENT_STATION_ID + element, beginTime, endtime);
    }

    public Observable<WeaResponse> getWeaMinCount(String staIds, String element, String beginTime, String endtime) {
        return mRetrofitService.getWeaMinCount(staIds, Constant.ELEMENT_STATION_ID + element, beginTime, endtime);
    }

    public Observable<Warn> getWarn() {
        return mRetrofitService.getWarn();
    }

    public Observable<LatestWea> getLatestWea(String staIds) {
        return mRetrofitService.getLatestWea(staIds);
    }

    public Observable<Fylz> getFylz() {
        return mRetrofitService.getFylz();
    }

    public Observable<Fore> getFore(String fileType) {
        return mRetrofitService.getFore(fileType);
    }

    public Observable<Past24> getPast(String staIds) {
        return mRetrofitService.getPast(staIds);
    }

    public Observable<AppInfo> getAppInfo() {
        return mRetrofitService.getAppInfo();
    }
}
